package org.btik.light.mobile.ui.devs.camquadruped;

import android.view.View;
import android.widget.CompoundButton;
import org.btik.light.mobile.common.handler.SimpleController;
import org.btik.light.mobile.common.handler.adaptor.ClickerAdaptor;
import org.btik.light.mobile.common.handler.adaptor.DevBinderOnCheckedChangeListener;
import org.btik.light.mobile.common.handler.adaptor.TurnEventHandler;


public interface CamQuadrupedHandlers {

    int ACTION_OP = 2;

    String FORWARD = "0";
    String BACKWARD = "1";

    String TURN_RIGHT = "2";

    String TURN_LEFT = "3";

    int ALL_PIN_ACTION_OP = 3;
    String STOP = "0";
    String RESET = "1";
    /**
     * 高抬腿
     */
    String HIGHER_STEPS = "2";
    /**
     * 正常高度
     */
    String STEP_HIGH_RESET = "3";
    /**
     * 小步行走
     */
    String SMALLER_STEPS = "4";
    /**
     * 正常步子
     */
    String STEP_LENGTH_RESET = "5";

    int CAM_GENERAL_OP = 4;

    String START_SEND = "0";
    String STOP_SEND = "1";

    String LED_ON = "2";

    String LED_OFF = "3";
    /**
     * 前
     */
    View.OnClickListener GO_FORWARD = new ClickerAdaptor(new SimpleController(ACTION_OP, FORWARD));

    /**
     * 倒车
     */
    View.OnClickListener GO_BACKWARD = new ClickerAdaptor(new SimpleController(ACTION_OP, BACKWARD));

    /**
     * 停
     */
    View.OnClickListener TO_STOP = new ClickerAdaptor(new SimpleController(ALL_PIN_ACTION_OP, STOP));

    /**
     * 左转
     */
    View.OnTouchListener TO_TURN_LEFT = new TurnEventHandler(new SimpleController(ACTION_OP, TURN_LEFT), new SimpleController(ALL_PIN_ACTION_OP, STOP));
    /**
     * 右转
     */
    View.OnTouchListener TO_TURN_RIGHT = new TurnEventHandler(new SimpleController(ACTION_OP, TURN_RIGHT), new SimpleController(ALL_PIN_ACTION_OP, STOP));

    /**
     * 停
     */
    View.OnClickListener SERVO_RESET = new ClickerAdaptor(new SimpleController(ALL_PIN_ACTION_OP, RESET));

    SimpleController STEP_HIGH = new SimpleController(ALL_PIN_ACTION_OP, HIGHER_STEPS);

    SimpleController STEP_HIGH_RESET_ = new SimpleController(ALL_PIN_ACTION_OP, STEP_HIGH_RESET);

    CompoundButton.OnCheckedChangeListener STEP_HIGH_SWITCH = new DevBinderOnCheckedChangeListener(
            STEP_HIGH, STEP_HIGH_RESET_
    );

    SimpleController SMALLER_STEP = new SimpleController(ALL_PIN_ACTION_OP, SMALLER_STEPS);

    SimpleController STEP_LENGTH_RESET_ = new SimpleController(ALL_PIN_ACTION_OP, STEP_LENGTH_RESET);

    CompoundButton.OnCheckedChangeListener STEP_LENGTH_SWITCH = new DevBinderOnCheckedChangeListener(
            SMALLER_STEP, STEP_LENGTH_RESET_
    );

    SimpleController VIDEO_ON = new SimpleController(CAM_GENERAL_OP, START_SEND);

    SimpleController VIDEO_0FF = new SimpleController(CAM_GENERAL_OP, STOP_SEND);

    SimpleController LIGHT_ON = new SimpleController(CAM_GENERAL_OP, LED_ON);

    SimpleController LIGHT_OFF = new SimpleController(CAM_GENERAL_OP, LED_OFF);

    CompoundButton.OnCheckedChangeListener VIDEO_SWITCH = new DevBinderOnCheckedChangeListener(
            VIDEO_ON, VIDEO_0FF
    );

    CompoundButton.OnCheckedChangeListener LIGHT_SWITCH = new DevBinderOnCheckedChangeListener(LIGHT_ON, LIGHT_OFF);


}
